// import {mapState} from 'vuex';
import { useMainStore } from "@/store/modules/store";
import { getDictSelectList } from "@/pages/RdsViews/components/RelatedName";

const DateSettingArray = [
    '近一周',
    '近一月',
    '近半年',
    '近一年',
    '近五年',
    '今天',
    "当天",
    '昨天',
    '昨天当天',
    '本周',
    '上周',
    '本季',
    '上季',
    '本月',
    '上月',
    '整季',
    '整年',
    '整月'
];

const SingleValueTypeArray = [
    '前天',
    '#当前用户',
    '#当前用户名',
    '#当前用户机构',
    '#当前用户机构名称',
    '#当前机构',
    '#当前机构名称',
    '#上月今天',
    '#去年今天',
    '#半年初',
    '#本周',
    '#上周初',
    '#上周末',
    '#本月',
    '#本月初',
    '#本月末',
    '#上月初',
    '#上月末',
    '#去年本月初',
    '#去年本月末',
    '#今天',
    '#昨天',
    '#明天',
    '#上周同期',
    '#上月同期',
    '#上年同期',
    '#上年同周',
    '#上月同周',
    '#本季度初',
    '#本季度末',
    '#去年本季度初',
    '#去年本季度末',
    '#上季度初',
    '#上季度末',
    '#本年初',
    '3月前今天',
    '#本年末'
];

const DefaultValueOptionArray = [...DateSettingArray, ...SingleValueTypeArray];

function isOption(option) {
    return (option || '').indexOf('#') === 0;
}

/**
 * 裁剪入参，如：#今天-1
 *
 * @param option 入参
 * @returns {{offest: number, prefix: (string|string)}|{offest: (number|number), prefix: string}}
 */
function cutPrefix(option) {
    const newOption = option.toString() || '';
    if (newOption.indexOf('+') > 0) {
        // 对于包含加号的情况处理...
        const splitOption = newOption.split('+');
        return {prefix: splitOption[0], offest: isNumber(splitOption[1]) ? Number.parseInt(splitOption[1]) : 0};
    } else if (newOption.indexOf('-') > 0) {
        // 对于包含减号的情况处理...
        const splitOption = newOption.split('-');
        return {prefix: splitOption[0], offest: isNumber(splitOption[1]) ? -Number.parseInt(splitOption[1]) : 0};
    }
    return {prefix: newOption, offest: 0};
}

/**
 * 判断字符串是否是数字
 *
 * @param str 字符串
 * @returns {boolean} true or false
 */
function isNumber(str) {
    const num = parseInt(str, 10);
    return !isNaN(num) && Number.isInteger(num);
}

/**
 * 获取季度开始日期
 *
 * @param year 某年
 * @param quarter 某季度
 * @returns {Date} 某年某季度开始日期
 */
function yearQuarterBegin(year, quarter) {
    // 验证输入的季度是否在1到4之间
    if (quarter < 1) {
        quarter = 1;
    } else if (quarter > 4) {
        quarter = 4;
    }
    // 根据季度调整起始月份
    const startMonth = (quarter - 1) * 3;
    // 创建对应季度初的日期
    return new Date(year, startMonth, 1);
}

/**
 * 获取季度结束日期
 *
 * @param year 某年
 * @param quarter 某季度
 * @returns {Date} 某年某季度结束日期
 */
function yearQuarterEnd(year, quarter) {
    // 验证输入的季度是否在1到4之间
    if (quarter < 1) {
        quarter = 1;
    } else if (quarter > 4) {
        quarter = 4;
    }
    // 根据季度调整结束月份
    const endMonth = (quarter * 3) - 1;
    // 创建一个日期对象指向季度末的下一个月的第一天，然后减去一天得到季度末的最后一天
    const endDate = new Date(year, endMonth, 1);
    // 减去一天以得到上个月的最后一天，即季度末
    endDate.setDate(endDate.getDate() - 1);
    return endDate;
}

/**
 * 当前时间的季度初
 *
 * @param date 当前时间
 * @returns {Date} 季度初
 */
function quarterBegin(date) {
    const month = date.getMonth();
    const quarter = Math.ceil(month / 3);
    let begin;
    switch (quarter) {
        case 1:
            begin = new Date(date.getFullYear(), 0, 1);
            break;
        case 2:
            begin = new Date(date.getFullYear(), 3, 1);
            break;
        case 3:
            begin = new Date(date.getFullYear(), 6, 1);
            break;
        case 4:
            begin = new Date(date.getFullYear(), 9, 1);
            break;
    }
    return begin;
}

/**
 * 当前时间的季度末
 *
 * @param date 当前时间
 * @returns {Date} 季度末
 */
function quarterEnd(date) {
    const month = date.getMonth();
    const quarter = Math.ceil(month / 3);
    let end;
    switch (quarter) {
        case 1:
            end = new Date(date.getFullYear(), 2, 31);
            break;
        case 2:
            end = new Date(date.getFullYear(), 5, 30);
            break;
        case 3:
            end = new Date(date.getFullYear(), 8, 30);
            break;
        case 4:
            end = new Date(date.getFullYear(), 1, 31);
            break;
    }
    end.setHours(23, 59, 59, 999);
    return end;
}

/**
 * 格式化时间，默认YYYY-MM-DD HH:mm:ss
 *
 * @param date 时间
 * @param formatter 时间格式，例如YYYY-MM-DD
 * @returns {string} 格式化后的时间
 */
function format(date, formatter) {
    const isoStr = date.toISOString().replace('T', ' ').replace('Z', '');
    let sliceStr;
    switch (formatter) {
        case 'YYYY':
            sliceStr = isoStr.slice(0, 4);
            break;
        case 'YYYY-MM':
            sliceStr = isoStr.slice(0, 7);
            break;
        case 'YYYY-MM-DD':
            sliceStr = isoStr.slice(0, 10);
            break;
        case 'YYYY-MM-DD HH':
            sliceStr = isoStr.slice(0, 13);
            break;
        case 'YYYY-MM-DD HH:mm':
            sliceStr = isoStr.slice(0, 16);
            break;
        case 'YYYY-MM-DD HH:mm:ss.SSS':
            // 直接return
            sliceStr = isoStr;
            break;
        case 'HH:mm:ss':
            sliceStr = isoStr.slice(11, 19);
            break;
        case 'YYYY-MM-DD HH:mm:ss':
        default:
            sliceStr = isoStr.slice(0, 19);
            break;
    }
    return sliceStr;
}

/**
 * 传入的时间增减
 *
 * @param date 传入的时间
 * @param offset 要增减的值
 * @param dateType 时间类型，可选值：year, month, day, hour, minute, second
 */
function add(date, offset, dateType) {
    switch (dateType.toLowerCase()) {
        case 'year':
            date.setFullYear(date.getFullYear() + offset);
            break;
        case 'month': {
            let originalDate = date.getDate();
            date.setMonth(date.getMonth() + offset);
            // 处理月份变化可能导致的日期溢出
            if (date.getDate() < originalDate) {
                date.setDate(0);
            }
            break;
        }
        case 'hour':
            date.setHours(date.getHours() + offset);
            break;
        case 'minute':
            date.setMinutes(date.getMinutes() + offset);
            break;
        case 'second':
            date.setSeconds(date.getSeconds() + offset);
            break;
        default:
        case 'day':
            date.setDate(date.getDate() + offset);
            break;
    }

    return date;
}

/**
 * 日初
 *
 * @param date 时间
 * @returns {Date} 某一天的0时0分0秒
 */
function dayBegin(date) {
    return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0, 0);
}

/**
 * 日末
 *
 * @param date 时间
 * @returns {Date} 某一天的23时59分59秒
 */
function dayEnd(date) {
    return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59, 999);
}

/**
 * 月初
 *
 * @param date 时间
 * @returns {Date} 某个月的第一天0时0分0秒
 */
function monthBegin(date) {
    return new Date(date.getFullYear(), date.getMonth(), 1, 0, 0, 0, 0);
}

/**
 * 月末
 *
 * @param date 时间
 * @returns {Date} 某个月的最后一天23时59分59秒
 */
function monthEnd(date) {
    let newDt = new Date(date.getFullYear(), date.getMonth() + 1, 1, 0, 0, 0, 0);
    newDt.setMilliseconds(-1);
    return newDt;
}

/**
 * 星期一
 *
 * @param date 时间
 * @returns {Date} 某星期的第一天0时0分0秒
 */
function weekBegin(date) {
    let day = date.getDay() || 7;
    return new Date(date.getFullYear(), date.getMonth(), date.getDate() - day + 1, 0, 0, 0, 0);
}

/**
 * 星期天
 *
 * @param date 时间
 * @returns {Date} 某星期的最后一天23时59分59秒
 */
function weekEnd(date) {
    let day = date.getDay() || 7;
    return new Date(date.getFullYear(), date.getMonth(), date.getDate() - day + 7, 23, 59, 59, 999);
}

/**
 * 年初
 *
 * @param date 时间
 * @returns {Date} 某一年的第一天0时0分0秒
 */
function yearBegin(date) {
    return new Date(date.getFullYear(), 0, 1, 0, 0, 0, 0);
}

/**
 * 年末
 *
 * @param date 时间
 * @returns {Date} 某一年的最后一天23时59分59秒
 */
function yearEnd(date) {
    return new Date(date.getFullYear(), 11, 31, 23, 59, 59, 999);
}

function convertValue(option, defaultFormat = 'YYYY-MM-DD') {
    let value = option || '';
    const {prefix, offest} = isOption(value) ? cutPrefix(option) : {prefix: value, offest: 0};
    const date = new Date();
    const mainStore = useMainStore();
    const { loginInfo } = mainStore;

    switch (prefix) {
        case '#上周同期':
            value = format(add(date, offest - 7, 'day'), defaultFormat);
            break;
        case '#上年同周':
            break;
        case '#上月同期':
            break;
        case '#今天':
            value = format(add(date, offest, 'day'), defaultFormat);
            break;
        case "#今天起":
            value = format(add(dayBegin(date), offest, 'day'), defaultFormat);
            break;
        case "#今天止":
            value = format(add(dayEnd(date), offest, 'day'), defaultFormat);
            break;
        case '#昨天':
            value = format(add(date, offest - 1, 'day'), defaultFormat);
            break;
        case '#前天':
            value = format(add(date, offest - 2, 'day'), defaultFormat);
            break;
        case '#明天':
            value = format(add(date, offest + 1, 'day'), defaultFormat);
            break;
        case '#后天':
            value = format(add(date, offest + 2, 'day'), defaultFormat);
            break;
        case '#去年今天':
            value = format(add(add(date, -1, 'year'), offest, 'day'), defaultFormat);
            break;
        case '#前五年今天':
            value = format(add(add(date, -5, 'year'), offest, 'day'), defaultFormat);
            break;
        case '#半年初':
            value = format(add(monthBegin(add(date, -6, 'month')), offest, 'day'), defaultFormat);
            break;
        case '#去年本季度初':
            value = format(add(quarterBegin(add(date, -1, 'year')), offest, 'day'), defaultFormat);
            break;
        case '#去年本季度末':
            value = format(add(quarterEnd(add(date, -1, 'year')), offest, 'day'), defaultFormat);
            break;
        case '#去年本月初':
            value = format(add(monthBegin(add(date, -1, 'year')), offest, 'day'), defaultFormat);
            break;
        case '#去年本月末':
            value = format(add(monthEnd(add(date, -1, 'year')), offest, 'day'), defaultFormat);
            break;
        case '#当前机构':
            value = loginInfo.sStoreId || '';
            break;
        case '#当前机构名称':
            value = loginInfo.sStoreName || '';
            break;
        case '#当前用户':
            value = loginInfo.sUser || '';
            break;
        case '#当前用户名':
            value = loginInfo.sUserName || '';
            break;
        case '#当前用户机构':
            value = loginInfo.sUserStore || '';
            break;
        case '#当前用户机构名称':
            value = loginInfo.sUserStoreName || '';
            break;
        case '#本周':
        case '#本周初':
            value = format(add(weekBegin(date), offest, 'day'), defaultFormat);
            break;
        case "#本周末":
            value = format(add(weekEnd(date), offest, 'day'), defaultFormat);
            break;
        case '#上周初':
            value = format(add(weekBegin(add(date, -7, 'day')), offest, 'day'), defaultFormat);
            break;
        case '#上周末':
            value = format(add(weekEnd(add(date, -7, 'day')), offest, 'day'), defaultFormat);
            break;
        case '#本季度初':
            value = format(add(quarterBegin(date), offest, 'day'), defaultFormat);
            break;
        case '#本季度末':
            value = format(add(quarterEnd(date), offest, 'day'), defaultFormat);
            break;
        case '#上季度初':
            value = format(add(quarterBegin(add(date, -3, 'month')), offest, 'day'), defaultFormat);
            break;
        case '#上季度末':
            value = format(add(quarterEnd(add(date, -3, 'month')), offest, 'day'), defaultFormat);
            break;
        case '#本年初':
            value = format(add(yearBegin(date), offest, 'day'), defaultFormat);
            break;
        case '#本年末':
            value = format(add(yearEnd(date), offest, 'day'), defaultFormat);
            break;
        case '#去年初':
            value = format(add(yearBegin(add(date, -1, 'year')), offest, 'day'), defaultFormat);
            break;
        case '#去年末':
            value = format(add(yearEnd(add(date, -1, 'year')), offest, 'day'), defaultFormat);
            break;
        case '#本月':
        case '#本月初':
            value = format(add(monthBegin(date), offest, 'day'), defaultFormat);
            break;
        case '#本月末':
            value = format(add(monthEnd(date), offest, 'day'), defaultFormat);
            break;
        case '#上月初':
            value = format(add(monthBegin(add(date, -1, 'month')), offest, 'day'), defaultFormat);
            break;
        case '#上月末':
            value = format(add(monthEnd(add(date, -1, 'month')), offest, 'day'), defaultFormat);
            break;
        case '#上月今天':
            value = format(add(date, offest - 1, 'day'), defaultFormat);
            break;
        case '#3月前今天':
            value = format(add(date, offest - 3, 'day'), defaultFormat);
            break;
        default:
            const range = toRangeDate(option, defaultFormat);
            if (range && range.beginDate && range.endDate) {
                value = [range.beginDate, range.endDate];
            }
            break;
    }
    return value;
}

function toRangeDate(key, defaultFormat = 'YYYY-MM-DD') {
    let dateRange;
    switch (key) {
        case "近2天":
            dateRange = {beginDate: convertValue('#前天'), endDate: convertValue('#今天')};
            break;
        case "近1周":
        case "近一周":
            dateRange = {beginDate: convertValue('#上周同期'), endDate: convertValue('#今天')};
            break;
        case '近一月':
        case '近1月':
            dateRange = {beginDate: convertValue('#上月今天'), endDate: convertValue('#今天')};
            break;
        case '近3月':
            dateRange = {beginDate: convertValue('#3月前今天'), endDate: convertValue('#今天')};
            break;
        case '近半年':
            dateRange = {beginDate: convertValue('#半年初'), endDate: convertValue('#今天')};
            break;
        case '近1年':
        case '近一年':
            dateRange = {beginDate: convertValue('#去年今天'), endDate: convertValue('#今天')};
            break;
        case '近五年':
            dateRange = {beginDate: convertValue('#前五年今天'), endDate: convertValue('#今天')};
            break;
        case '今天':
            dateRange = {beginDate: convertValue('#今天'), endDate: convertValue('#今天')};
            break;
        case "当天":
            dateRange = {beginDate: convertValue("#今天起"), endDate: convertValue("#今天止")};
            break;
        case '昨天':
            dateRange = {beginDate: convertValue('#昨天'), endDate: convertValue('#今天')};
            break;
        case '昨天当天':
            dateRange = {beginDate: convertValue('#昨天'), endDate: convertValue('#昨天')};
            break;
        case '本周':
            dateRange = {beginDate: convertValue('#本周'), endDate: convertValue('#本周末')};
            break;
        case '上周':
            dateRange = {beginDate: convertValue('#上周初'), endDate: convertValue('#上周末')};
            break;
        case '本季':
            dateRange = {beginDate: convertValue('#本季度初'), endDate: convertValue('#本季度末')};
            break;
        case '上季':
            dateRange = {beginDate: convertValue('#上季度初'), endDate: convertValue('#上季度末')};
            break;
        case '本月':
            dateRange = {beginDate: convertValue('#本月初'), endDate: convertValue('#本月末')};
            break;
        case '本年':
            dateRange = {beginDate: convertValue('#本年初'), endDate: convertValue('#本年末')};
            break;
        case '上月':
            dateRange = {beginDate: convertValue('#上月初'), endDate: convertValue('#上月末')};
            break;
        case '去年':
            dateRange = {beginDate: convertValue('#去年初'), endDate: convertValue('#去年末')};
            break;
        case '整年':
            dateRange = {beginDate: convertValue('#本年初'), endDate: convertValue('#本年末')};
            break;
        case '整季':
            dateRange = {beginDate: convertValue('#本季度初'), endDate: convertValue('#本季度末')};
            break;
        case '整月':
            dateRange = {beginDate: convertValue('#本月初'), endDate: convertValue('#本月末')};
            break;
        default:
            dateRange = {beginDate: convertValue('#本月初'), endDate: convertValue('#今天')};
            break;
    }

    return {
        beginDate: format(dayBegin(dateRange.beginDate), defaultFormat),
        endDate: format(dayEnd(dateRange.endDate), defaultFormat)
    };
}

function getType(condition) {
    const method = condition.InputMethod || '';
    let type;
    if (method.startsWith('选择日期')) {
        type = 'date';
    } else if (method.includes('选一')) {
        type = 'radio';
    } else if (method.includes('多选')) {
        type = 'multi';
    } else if (method.startsWith('下拉选择')) {
        type = 'selector';
    } else if (method === '直接输入') {
        if (condition.DataType === 'sdt' || condition.DataType === 'edt') {
            type = 'date';
        } else {
            type = 'text';
        }
    } else if (method.includes('store') || method.includes('depart') ||
        method.includes('rds_gdsclass') || method.includes('rds_brand') ||
        method.includes('rds_partner')) {
        type = 'textname';
    } else if (method.includes('行数')) {
        type = 'number';
    } else if (method === '维度列') {
        type = 'radio';
    } else {
        type = 'text';
    }
    return type;
}

function getRef(condition) {
    const method = condition.InputMethod || '';
    let ref = null;
    switch (method) {
        case 'rds_channel':
            // todo 待补充 渠道
            ref = 'cardChannelInput';
            break;
        case 'store-limit':
            // 机构
            ref = 'cardStoreInput';
            break;
        case 'departs-limit':
            // 部门
            ref = 'cardAdnoInput';
            break;
        case 'rds_gdsclasses':
            // todo 待补充 品类
            ref = 'cardGdsClassInput';
            break;
        case 'rds_brand':
            // todo 待补充 品牌
            ref = 'cardBrandInput';
            break;
        case 'rds_complexgdss':
            // 商品
            ref = 'cardGdsInput';
            break;
    }
    return ref;
}

function getRange(condition) {
    const type = condition.ParamType || '';
    const method = condition.InputMethod || '';
    let range = null;
    if (!['selector', 'multi', 'radio'].includes(type)) {
        return range;
    }
    if (method.includes('系统字典')) {
        let dictList = getDictSelectList(condition.ParamCName);
        range = dictList ? dictList : [];
    } else if (condition.Param1 && condition.Param1.includes('|') && condition.Param1.includes(',')) {
        let parts = condition.Param1.split(',');
        range = parts.map(part => {
            // 每个元素用'|'分割
            const [text, value] = part.split('|');
            // 返回一个对象，text和value相同，checked默认值为false
            return { text, value, checked: false };
        });
    } else {
        range = [
            {text: condition.Param1, value: condition.Param1, checked: false},
            {text: condition.Param2, value: condition.Param2, checked: false},
            {text: condition.Param3, value: condition.Param3, checked: false},
            {text: condition.Param4, value: condition.Param4, checked: false},
            {text: condition.Param5, value: condition.Param5, checked: false},
        ];
    }
    range = range.filter(value => value.value !== '')
    // 若未返回param,设置默认值
    if (range.length === 0 && (condition.DefaultValue === '是' || condition.DefaultValue === '否')) {
        range = [
            {text: '是', value: '是', checked: false},
            {text: '否', value: '否', checked: false},
        ]
    }
    return range;
}

function getTitle(condition) {
    const type = condition.DataType || '';
    let newTitle = condition.Title;
    if (type === 'sdt') {
        newTitle = newTitle + '(起始)'
    } else if (type === 'edt') {
        newTitle = newTitle + '(结束)'
    }
    return newTitle;
}

function getPlaceholder(condition) {
    const method = condition.InputMethod || '';
    if (method.includes('store')) {
        return '请选择机构'
    } else if (method.includes('depart')) {
        return '请选择部门'
    } else if (method.includes('rds_gdsclass')) {
        return '请选择品类'
    } else if (method.includes('rds_brand')) {
        return '请选择品牌'
    } else if (method.includes('rds_partner')) {
        return '请选择供应商'
    } else if (method === 'rds_channel') {
        return '请输入渠道'
    } else if (method === 'rds_complexgdss') {
        return '请输入商品'
    } else {
        return '';
    }
}

function getNewValue(data, meta) {
    let { DataField, Format, DataType } = meta;
    let originalData = data[DataField];
    if (Format && Format.length > 0) {
        if (Format.includes('#,#')) {
            let list = Format.split(';');
            if (list[0]) {
                let format = list[0];
                const numberFormatter = {
                    // 获取小数位数
                    getDecimalPlaces: function(format) {
                        const match = format.match(/(\.0+)/);
                        return match ? match[0].length - 1 : 0; // 小数点后的0的个数
                    },
                    // 处理千位分隔符
                    addCommas: function(num) {
                        const parts = num.split('.');
                        parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ','); // 添加千位分隔符
                        return parts.join('.'); // 返回格式化后的结果
                    },
                    // 主要格式化函数
                    format: function(num, format) {
                        // 获取小数位数
                        const decimalPlaces = this.getDecimalPlaces(format);
                        // 根据小数位数格式化数字
                        let formattedNum = parseFloat(num).toFixed(decimalPlaces);
                        // 添加千位分隔符
                        formattedNum = this.addCommas(formattedNum);
                        return formattedNum;
                    }
                };
                if (format === '#,###.####' || format === '#,###.0000') {
                    format = '#,##0.0000';
                } else if (format === '#,###.###' || format === '#,###.000') {
                    format = '#,##0.000';
                } else if (format === '#,###.##' || format === '#,###.00') {
                    format = '#,##0.00';
                } else if (format === '#,###.#' || format === '#,###.0') {
                    format = '#,##0.0';
                }
                originalData = numberFormatter.format(originalData || 0, format);
            }
        } else if (Format.includes('%')) {
            originalData = convertToPercentage(Format, originalData);
        } else if (Format ==='P') {
            originalData = convertToPercentage('12.34%', originalData);
        }
    }
    return originalData;
}

function convertToPercentage(format, value) {
    // 提取第一个参数格式中的小数位数
    const decimalPlaces = (format.match(/\.(\d+)/) || [])[1]?.length || 0;
    // 将第二个参数转化为百分比并根据小数位数格式化
    const percentage = (value * 100).toFixed(decimalPlaces);
    return `${percentage}%`;
}

function getHeadValue(data) {
    const { ParamValue, InputMethod, ParamType, ParamCName } = data;
    if (InputMethod.includes('系统字典') && (ParamType === 'radio' || ParamType === 'multi' || ParamType === 'selector')) {
        let inputValues = ParamValue.split(',');
        let resultTexts = [];
        let mapping = getDictSelectList(ParamCName);
        // 遍历输入值并查找对应的文本
        inputValues.forEach(value => {
            // 在字典中查找匹配的值
            const foundItem = mapping.find(item => item.value === value);
            if (foundItem) {
                resultTexts.push(foundItem.text);
            }
        });
        if (resultTexts.length > 0) {
            return resultTexts.join(',');
        }
    }
    return ParamValue;
}

function getAlignType(data, meta) {
    let { DataField = '' } = meta;
    let originalData = data[DataField];
    if (typeof originalData === 'number') {
        return 'text-align: right;';
    }
    return 'text-align: left;';
}

export {
    DateSettingArray,
    SingleValueTypeArray,
    DefaultValueOptionArray,
    isOption,
    cutPrefix,
    isNumber,
    yearQuarterBegin,
    yearQuarterEnd,
    quarterBegin,
    quarterEnd,
    format,
    add,
    dayBegin,
    dayEnd,
    monthBegin,
    monthEnd,
    weekBegin,
    weekEnd,
    yearBegin,
    yearEnd,
    convertValue,
    toRangeDate,
    getType,
    getRef,
    getRange,
    getTitle,
    getPlaceholder,
    getNewValue,
    getHeadValue,
    getAlignType,
}
